#ifndef _STRAWGUI_CR_FRAME_H_
#define _STRAWGUI_CR_FRAME_H_

#include "sComponentRect.h"
#include "sTRFrame.h"
#include "sPresetGroup.h"

namespace sgui
{
namespace res
{

class sComponentRectFrame : public sComponentRect
{
public:
    typedef preset::sGroup<sTextureResourceFrame> sFrameGroup;
private:
	std::deque<sFrameGroup*> m_frames;
public:
	preset::sGroup<sTextureResourceFrame>&	getFrame(u32 idx = 0) { return *m_frames[idx]; };
	const preset::sGroup<sTextureResourceFrame>& getFrame(u32 idx = 0) const { return *m_frames[idx]; };
    std::deque<sFrameGroup*>& getFrames() { return m_frames; }
		
	void load(const db::Record &file);
	void save(db::Record &file) const;
	void clear();

	const EComponentRectType getClass() const { return COMPONENT_RECT_FRAME; }
	inst::sComponentRectInstance* getInstance(inst::sComponentInstance& instanceFor, s32 id) const;

#ifdef _EDITOR
	void exportRTTI(rtti::sInfoList& list);
#endif
	sComponentRectFrame(sGUI& gui);
};

};
};

#endif